using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SensorVisual
{
    public partial class SeleccionAlgoritmo : Form
    {
        private int seleccion;
        public int Seleccion
        {
          get { return seleccion; }
        }

        public SeleccionAlgoritmo(int ai_seleccion)
        {
            InitializeComponent();

            seleccion = ai_seleccion;
            if (seleccion == 1)
                radioButton1.Checked = true;
            else if (seleccion == 2)
                radioButton2.Checked = true;
            else if (seleccion == 3)
                radioButton3.Checked = true;
        }

        private void CheckSelection()
        {
            if (radioButton1.Checked == true)
                seleccion = 1;
            else if (radioButton2.Checked == true)
                seleccion = 2;
            else if (radioButton3.Checked == true)
                seleccion = 3;
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            CheckSelection();
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            CheckSelection();
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            CheckSelection();
        }
    }
}